#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
#include "Parameters.h"
// create a map(array) from a text file
int (*newMap())[SIZE_HEIGHT][SIZE_WIDTH]
{
    static const char filename[] = "input.txt"; /* the name of a file to open */
    FILE *file = fopen(filename, "r"); /* try to open the file */
    static int map[SIZE_HEIGHT][SIZE_WIDTH];

    char line[BUFSIZ]; /* space to read a line into */
    int k = 0;
    while ( fgets(line, sizeof line, file)!=NULL && k<SIZE_HEIGHT) /* read each line */
    {
        int i;
        char *token = line; /* point to the beginning of the line */

        for ( i = 0; i<SIZE_WIDTH; i++ )
        {
            map[k][i]=((int)*token)-48;
            token+=sizeof(char);
            printf("map[%d][%d]=%d\n", (int)k,(int)i,map[k][i]);
        }
        puts("----\n");
        k++;
    }
    fclose(file);

    return &map;




}
